package formulario;

import com.opensymphony.xwork2.ActionSupport;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.ServletActionContext;

public class CargaFormulario extends ActionSupport {
    
    private Map<Integer,String> listaValores = new TreeMap<Integer, String>();
    private Map<String,String> listaValores2 = new TreeMap<String, String>();
    
    @Override
    public String execute() throws Exception {
        HttpServletRequest request = ServletActionContext.getRequest();
        HttpServletResponse response = ServletActionContext.getResponse();
        ServletContext application = ServletActionContext.getServletContext();
        
        listaValores.put(-1, "Seleccione...");
        listaValores.put(1, "Uno");
        listaValores.put(2, "Dos");
        listaValores2.put("ns", "Seleccione...");
        listaValores2.put("uno", "Uno");
        listaValores2.put("dos", "Dos");
//        request.setAttribute("listaValores", listaValores);
        
        return SUCCESS;
    }

    public Map<String, String> getListaValores2() {
        return listaValores2;
    }

    public void setListaValores2(Map<String, String> listaValores2) {
        this.listaValores2 = listaValores2;
    }

    public Map<Integer, String> getListaValores() {
        return listaValores;
    }

    public void setListaValores(Map<Integer, String> listaValores) {
        this.listaValores = listaValores;
    }


}

